package com.zyz.I_多线程.线程生命周期;

/**
 * @author: vick
 * @Date: 2025/3/22
 * @Description:
 * @version: 1.0
 */
public class Test2 {
    public static void main(String[] args) throws InterruptedException {
        ThreadState threadState = new ThreadState();
        System.out.println(threadState.getName() + "状态：" + threadState.getState());
        threadState.start();
        while (Thread.State.TERMINATED != threadState.getState()) {
            System.out.println(threadState.getName() + "状态：" + threadState.getState());
            Thread.sleep(500);
        }
        System.out.println(threadState.getName() + "状态：" + threadState.getState());
    }
}
